<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
include_once 'master.php';

class Home extends Master {

	function Home()	{
		parent::Master();	
	}
	
	function index()	{
		// Encrypted
		//'lKq5iNSMzY8VBUOIcABoGfCl3PEiOYFAEge3ziZPE5wfk/Yu+P2qdPJMoCBCy6I2csOq5PxrkB/BAe4p7XJM5Q=='
		$r = openssl_pkey_get_private("file://c:/web/buzzthenet/key.pem");
		$ret = '';
		openssl_private_decrypt(base64_decode('lKq5iNSMzY8VBUOIcABoGfCl3PEiOYFAEge3ziZPE5wfk/Yu+P2qdPJMoCBCy6I2csOq5PxrkB/BAe4p7XJM5Q=='),&$ret,$r);
		echo $ret;
	}
	
	function test() {
		//Form
		$this->_set_scripts('jquery.form-2.03.js');
		//Encrypt
		$this->_set_scripts('prng4.js');
		$this->_set_scripts('jsbn.js');
		$this->_set_scripts('rng.js');
		$this->_set_scripts('rsa.js');
		$this->_set_scripts('base64.js');
		//My
		$this->_set_scripts('app/home-0.1.js');
		
		$data['pkey'] = 'DEA81C9EA832C922A9FF44B4C623D8AF711A467ADE4F8F8A01D2F2643808CA3A9C99DBF9233036F93BA8530CD671C4E4082F3E6C5545119CD9458D62A4505655';
		@$this->load->view('home', $data);
	}
	
	function icio_login() {
		$r = openssl_pkey_get_private("file://c:/web/buzzthenet/key.pem");
		//$r = openssl_pkey_get_private("file://./key.pem");
		$user = '';
		$pass = '';
		openssl_private_decrypt(base64_decode($this->input->post('username')),&$user,$r);
		openssl_private_decrypt(base64_decode($this->input->post('password')),&$pass,$r);
		echo $user, '<br>', htmlentities($pass),'<br>';
	}
	
	function info() {
		phpinfo();
	}
}
?>